Skip to content

ref(profiling): Remove unused ContinuousScheduler.pause stub - #8224

Open
sentry-junior[bot] wants to merge 1 commit into
masterfrom
junior/remove-continuous-scheduler-pause
Open

sentry-junior[bot] wants to merge 1 commit into
masterfrom
junior/remove-continuous-scheduler-pause

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Description

Removes ContinuousScheduler.pause() from sentry_sdk/profiler/continuous_profiler.py (3 lines). It's a stub that only raises NotImplementedError, and nothing implements it or calls it.

#2830 (Jun 2024, "Introduce continuous profiling mode") added it next to ensure_running() and teardown(). Unlike those two, no subclass ever overrode it, and the SDK never called it. The stub makes it look like the continuous profiler can be paused, but it can't.

Evidence

  • git grep -nw pause on master finds only the definition. Nothing in sentry_sdk/, tests/, scripts/ or docs/ refers to it.
  • ThreadContinuousScheduler and GeventContinuousScheduler, the only subclasses, override ensure_running() and teardown() but not pause().
  • git log -S "def pause" finds only feat(profiling): Introduce continuous profiling mode #2830. git log -S ".pause(" across sentry_sdk and tests finds no commits, so it has never had a caller.
  • ContinuousScheduler isn't exported from sentry_sdk.profiler (__all__ lists only the transaction-profiler schedulers) and isn't documented.
  • No open PR or issue mentions it. fix(profiler): reset ThreadContinuousScheduler lock after fork #7275 also touches continuous_profiler.py, but in different hunks (ThreadContinuousScheduler.__init__).

Why it's safe

  • ContinuousScheduler is an internal class. The method is unreachable, so behavior doesn't change, and no public API or documented behavior is affected.

Checks

  • uv run ruff check / ruff format --check on sentry_sdk/profiler: clean
  • uv run --group typing mypy sentry_sdk: no issues
  • TESTPATH=tests/profiler uv run tox -e py3.14-common: 106 passed, 69 skipped. The skipped tests are the gevent cases, which need gevent installed.

Issues

None. Found by the weekly sentry-python removal scout.

via automation sched_65eed06cc199036c2b13411096f412d4 · Run ID sched_65eed06cc199036c2b13411096f412d4:1794211200000.

--

View Session [Sentry]

ContinuousScheduler.pause() was added with continuous profiling in #2830
as a stub that raises NotImplementedError. Neither ThreadContinuousScheduler
nor GeventContinuousScheduler implements it and nothing has ever called it.
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner November 9, 2026 08:06
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 137221 passed | ⏭️ 7456 skipped | Total: 144677 | Pass Rate: 94.85% | Execution Time: 465m 29s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ Test counts unchanged from base.

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.32% (up 0.02 percentage points from base (d565fed) to head (89b468b)).

Files with missing lines (1)
File Coverage % Lines
sentry_sdk/profiler/continuous_profiler.py 93.53% ⚠️ 20 Missing and 8 partials
Coverage diff
@@            Coverage Diff             @@
##        master     #8224       +/-##
==========================================
+ Coverage    90.30%    90.32%    +0.02%
==========================================
  Files          203       203         —
  Tracked lines     26933     26931        -2
  Branches     10058     10058         —
==========================================
+ Hits         24321     24324        +3
+ Misses        2612      2607        -5
- Partials      1518      1520        +2

Generated by Coverage Action

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant